import axios from '@/functions/request';
function getDutyList(params){
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/auth/sysDuty/doGetList",params).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
}


function getAllOrganJsonByDutyId(params){
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/auth/sysdutyorgan/doGetAllOrganJsonByDutyId",params).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
}

function edit(prams){
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/auth/sysdutyorgan/doAddDutyOrgan",prams).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
    
}
function getUserListByDutyId(params) {
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/auth/sysuser/doGetSysUserListWithDutyId",params).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
}
function getUserListByOrganId(params) {
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/auth/sysuser/doGetList",params).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
}
function addDutyUser(params) {
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/auth/sysuserduty/doAddDutyUser",params).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
}
function delDutyUser(params) {
    return new Promise((resolve, reject)=>{
        axios.formPost( "/api/auth/sysuserduty/doDeleteUserDuty",params).then(res=>{
            resolve(res)
        }).catch(e => {
            reject(e)
        });
    })
}

// 


export {
    getDutyList,
    edit,
    getUserListByDutyId,
    getUserListByOrganId,
    getAllOrganJsonByDutyId,
    addDutyUser,
    delDutyUser
}